package com.kd.enums.product;

/**
 * 叉型枚举
 */
public enum SideForkEnum {
    TWO_SIDED(0, "二面叉"),
    FOUR_SIDED(1, "四面叉");

    private final Integer code;
    private final String desc;

    SideForkEnum(Integer code, String desc) {
        this.code  = code;
        this.desc  = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static SideForkEnum getByCode(Integer code) {
        for (SideForkEnum value : values()) {
            if (value.getCode().equals(code))  {
                return value;
            }
        }
        throw new IllegalArgumentException("无效的叉型代码: " + code);
    }
}